﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ScooterLand
{
    public partial class Form1 : Form
    {
        Backend.Program controller = new Backend.Program();
        private bool dbResult;

        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            dbResult = controller.DBTest();

            if (dbResult != true)
                MessageBox.Show("Der blev ikke oprettet forbindelse til database serveren.");
        }

        private void orderItem_Click(object sender, EventArgs e)
        {
            OrderForm oForm = new OrderForm();
            oForm.Show();
        }

        private void customersItem_Click(object sender, EventArgs e)
        {
            CustomerForm cForm = new CustomerForm();
            cForm.Show();
        }

        private void productsItem_Click(object sender, EventArgs e)
        {
            ProductForm pForm = new ProductForm();
            pForm.Show();
        }

        private void employeesItem_Click(object sender, EventArgs e)
        {
            EmployeeForm eForm = new EmployeeForm();
            eForm.Show();
        }

        private void invoicesItem_Click(object sender, EventArgs e)
        {
            InvoiceForm iForm = new InvoiceForm();
            iForm.Show();
        }

        private void exitItem_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void ordersBtn_Click(object sender, EventArgs e)
        {
            OrderForm oForm = new OrderForm();
            oForm.Show();
        }

        private void customersBtn_Click(object sender, EventArgs e)
        {
            CustomerForm cForm = new CustomerForm();
            cForm.Show();
        }

        private void productsBtn_Click(object sender, EventArgs e)
        {
            ProductForm pForm = new ProductForm();
            pForm.Show();
        }

        private void employeesBtn_Click(object sender, EventArgs e)
        {
            EmployeeForm eForm = new EmployeeForm();
            eForm.Show();
        }

        private void invoicesBtn_Click(object sender, EventArgs e)
        {
            InvoiceForm iForm = new InvoiceForm();
            iForm.Show();
        }

        private void exitBtn_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
